package javaBase.nowcoder.HJ31_B_单词倒排;

import java.io.*;

public class Main {
    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        String[] strs = str.replaceAll("[^a-zA-Z]{1,}", " ").split(" ");

        for (int i = strs.length - 1; i >= 0; i--) {
            System.out.print(strs[i] + " ");

        }
    }
}
